<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>sso单点登录</title>
</head>

<body>
    <div>所有系统的登录页都是用这个</div>
    <form action="/sso/protected" method="post">
        <label for="username">
            用户名<input name="username" type="text">
        </label>
        <label for="password">
            密码<input name="password" type="password">
        </label>
            <input name="appId" type="hidden" id="appId">
            <input name="redirect_url" type="hidden" id="url">
        <button type="submit">登录</button>
    </form>
    <script>
        const obj = {}
        const appId = location.search?.slice(1).split("&").forEach(item => {
            const [key, value] = item.split("=");
            obj[key] = value;
        })
        document.querySelector("#appId").value = obj.appId;
        document.querySelector("#url").value = obj.redirect_url;
    </script>
</body>

</html>